<?php
namespace Admin\Controller;
use Think\Controller;
class MeishisController extends BaseController{
public function meishislist(){
		$Meishismodel=M('meishis');
		$meishis=$Meishismodel->order('id asc')->select();
		$this->meishis=$meishis;
		//dump($find);
		$this->display();
	}
public function delmeishis($id){
 	
    
    $MeishisModel=M('meishis');
        $res=$MeishisModel->where("id=$id")->find();
        $photoPath = realpath("./Public/Uploads/meishisphoto/".$res['picture']);
        unlink($photoPath);
        //$res=$usersmodel->where("id=$id")->delete();
        if ($MeishisModel->delete($id)) {
            $this->success('删除成功！');
        } else {
            $this->error('删除失败');
        }




    }
        public function detail($id){
        //dump($id);
        $meishisModel=M('meishis');//实例化一个model对象
        $res=$meishisModel->where("id = $id")->select();//asc升序 desc降序
        $this->detail=$res;
        //dump($this->detail);
        $this->display();
    }




    }

	

